<?php

namespace App\Http\Requests\Wechat;

use Illuminate\Foundation\Http\FormRequest;

class MsgRuleRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        $rules = [
            'minute'=>'required|regex:[[1-9]+]',
            'msg'=>'required',
            'type'=>'required',
        ];
        return $rules;
    }

    public function messages(){
		return [
			'minute.required'=>"分钟不能为空",
			'minute.regex'=>"分钟必须是正整数",
			'msg.required'=>"信息不能为空",
			'type.required'=>"类型不能为空",
		];
	}
}
